package com.hshoesmall.demo.service.lmpl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hshoesmall.demo.mapper.ShoesOrderMapper;
import com.hshoesmall.demo.mapper.ShoesOrderShoesMapper;
import com.hshoesmall.demo.model.dto.ShoesOrderAddDTO;
import com.hshoesmall.demo.model.entity.ShoesOrder;
import com.hshoesmall.demo.service.ShoesOrderService;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class ShoesOrderServiceImpl extends ServiceImpl<ShoesOrderMapper, ShoesOrder> implements ShoesOrderService {



    @Override
    public ShoesOrder addOrder(ShoesOrderAddDTO dto) {
        ShoesOrder addOders = ShoesOrder.builder()
                .ouid(dto.getOuid())
                .orecid(dto.getOrecid())
                .onum(dto.getOnum())
                .ostate(dto.getOstate())
                .ototal(dto.getOtotal())
                .ointegral(dto.getOintegral())
                .onote(dto.getOnote())
                .oid(0)
                .oexpinfo("")
                .orderTime(new Date())
                .user_id(0)
                .receive_id(0)
                .build();
        baseMapper.insert(addOders);
        return addOders;
    }



}
